# -*- coding: utf-8 -*-

"""
@author: Laowang
@contact: QQ:1125564921
@Created on: 2022/6/20
@Remark: 
"""


from enum import Enum


# EVENT
EVENT_DB_DIRVER_PERSIST = "EVENT_DB_DIRVER_PERSIST"
EVENT_NOSQL_DIRVER_CACHE = "EVENT_CACHE_DIRVER"

# BASE-EVENT-TOPIC
EVENT_ORDER_STATUS = "EVENT_EVENT_ORDER_STATUS"
EVENT_ORDERS_STATUS = "EVENT_EVENT_ORDERS_STATUS"
EVENT_ORDER_TRADE = "EVENT_ORDER_TRADE"
EVENT_TICKER = "EVENT_TICKER"
EVENT_TICKERS = "EVENT_TICKERS"
EVENT_KLINE = "EVENT_KLINE"
EVENT_MARKETCONFIG = "EVENT_MARKETCONFIG"
EVENT_MARKETDEPTH = "EVENT_MARKETDEPTH"
EVENT_OPENORDER = "EVENT_OPENORDER"
EVENT_ACCOUNT = "EVENT_ACCOUNT"
EVENT_SENDORDERS = "EVENT_SENDORDERS"
EVENT_SENDORDER = "EVENT_SENDORDER"
EVENT_CANCELORDERS = "EVENT_CANCELORDERS"
EVENT_CANCELORDER = "EVENT_CANCELORDER"
EVENT_SERVERTIMES = "EVENT_SERVERTIMES"
EVENT_ACCOUNT_BALANCE = "EVENT_ACCOUNT_BALANCE"
EVENT_ACCOUNT_FUND = "EVENT_ACCOUNT_FUND"
EVENT_ACCOUNT_MINE_TRADES = "EVENT_ACCOUNT_MINE_TRADES"

# EX
EX_EVENT_ORDER_STATUS = "{}_" + EVENT_ORDER_STATUS
EX_EVENT_ORDERS_STATUS = "{}_" + EVENT_ORDERS_STATUS
EX_EVENT_ORDER_TRADE = "{}_" + EVENT_ORDER_TRADE
EX_EVENT_TICKER = "{}_" + EVENT_TICKER
EX_EVENT_TICKERS = "{}_" + EVENT_TICKERS
EX_EVENT_KLINE = "{}_" + EVENT_KLINE
EX_EVENT_MARKETCONFIG = "{}_" + EVENT_MARKETCONFIG
EX_EVENT_MARKETDEPTH = "{}_" + EVENT_MARKETDEPTH
EX_EVENT_OPENORDER = "{}_" + EVENT_OPENORDER
EX_EVENT_ACCOUNT = "{}_" + EVENT_ACCOUNT
EX_EVENT_SENDORDERS = "{}_" + EVENT_SENDORDERS
EX_EVENT_SENDORDER = "{}_" + EVENT_SENDORDER
EX_EVENT_CANCELORDERS = "{}_" + EVENT_CANCELORDERS
EX_EVENT_CANCELORDER = "{}_" + EVENT_CANCELORDER
EX_EVENT_SERVERTIMES = "{}_" + EVENT_SERVERTIMES
EX_EVENT_ACCOUNT_BALANCE = "{}_" + EVENT_ACCOUNT_BALANCE
EX_EVENT_ACCOUNT_FUND = "{}_" + EVENT_ACCOUNT_FUND
EX_EVENT_ACCOUNT_MINE_TRADES = "{}_" + EVENT_ACCOUNT_MINE_TRADES

# LOG
EVENT_LOG = "eLog"

# EXCHANGE


class Exchange(Enum):

    BINANCE = "BINANCE"
    HUOBI = "HUOBI"
    XT = "XT"
    XT4FUTURE = 'XT4FUTURE'
    XTFUTURE = 'XTFUTURE'
    MXC = "MXC"
    GATEIO = "GATEIO"
    FTX = 'FTX'
    XT4 = "XT4"

    BINANCE_CONTRACT = "BINANCE_CONTRACT"
    HUOBI_CONTRACT = "HUOBI_CONTRACT"
    XT_CONTRACT = "XT_CONTRACT"
    MXC_CONTRACT = "MXC_CONTRACT"
    GATEIO_CONTRACT = "GATEIO_CONTRACT"
    FTX_CONTRACT = 'FTX_CONTRACT'

    UNKNOWN = None


# XT-EX
XT = Exchange.XT.value
XT_EVENT_ORDER_STATUS = EX_EVENT_ORDER_STATUS.format(XT)
XT_EVENT_ORDERS_STATUS = EX_EVENT_ORDERS_STATUS.format(XT)
XT_EVENT_ORDER_TRADE = EX_EVENT_ORDER_TRADE.format(XT)
XT_EVENT_TICKER = EX_EVENT_TICKER.format(XT)
XT_EVENT_TICKERS = EX_EVENT_TICKERS.format(XT)
XT_EVENT_KLINE = EX_EVENT_KLINE.format(XT)
XT_EVENT_MARKETCONFIG = EX_EVENT_MARKETCONFIG.format(XT)
XT_EVENT_MARKETDEPTH = EX_EVENT_MARKETDEPTH.format(XT)
XT_EVENT_OPENORDER = EX_EVENT_OPENORDER.format(XT)
XT_EVENT_ACCOUNT = EX_EVENT_ACCOUNT.format(XT)
XT_EVENT_SENDORDERS = EX_EVENT_SENDORDERS.format(XT)
XT_EVENT_SENDORDER = EX_EVENT_SENDORDER.format(XT)
XT_EVENT_CANCELORDERS = EX_EVENT_CANCELORDERS.format(XT)
XT_EVENT_CANCELORDER = EX_EVENT_CANCELORDER.format(XT)
XT_EVENT_SERVERTIMES = EX_EVENT_SERVERTIMES.format(XT)
XT_EVENT_ACCOUNT_BALANCE = EX_EVENT_ACCOUNT_BALANCE.format(XT)
XT_EVENT_ACCOUNT_FUND = EX_EVENT_ACCOUNT_FUND.format(XT)
XT_EVENT_ACCOUNT_MINE_TRADES = EX_EVENT_ACCOUNT_MINE_TRADES.format(XT)

# XT4-EX
XT4 = Exchange.XT4.value
XT4_EVENT_ORDER_STATUS = EX_EVENT_ORDER_STATUS.format(XT4)
XT4_EVENT_ORDERS_STATUS = EX_EVENT_ORDERS_STATUS.format(XT4)
XT4_EVENT_ORDER_TRADE = EX_EVENT_ORDER_TRADE.format(XT4)
XT4_EVENT_TICKER = EX_EVENT_TICKER.format(XT4)
XT4_EVENT_TICKERS = EX_EVENT_TICKERS.format(XT4)
XT4_EVENT_KLINE = EX_EVENT_KLINE.format(XT4)
XT4_EVENT_MARKETCONFIG = EX_EVENT_MARKETCONFIG.format(XT4)
XT4_EVENT_MARKETDEPTH = EX_EVENT_MARKETDEPTH.format(XT4)
XT4_EVENT_OPENORDER = EX_EVENT_OPENORDER.format(XT4)
XT4_EVENT_ACCOUNT = EX_EVENT_ACCOUNT.format(XT4)
XT4_EVENT_SENDORDERS = EX_EVENT_SENDORDERS.format(XT4)
XT4_EVENT_SENDORDER = EX_EVENT_SENDORDER.format(XT4)
XT4_EVENT_CANCELORDERS = EX_EVENT_CANCELORDERS.format(XT4)
XT4_EVENT_CANCELORDER = EX_EVENT_CANCELORDER.format(XT4)
XT4_EVENT_SERVERTIMES = EX_EVENT_SERVERTIMES.format(XT4)
XT4_EVENT_ACCOUNT_BALANCE = EX_EVENT_ACCOUNT_BALANCE.format(XT4)
XT4_EVENT_ACCOUNT_FUND = EX_EVENT_ACCOUNT_FUND.format(XT4)
XT4_EVENT_ACCOUNT_MINE_TRADES = EX_EVENT_ACCOUNT_MINE_TRADES.format(XT4)

# XTFUTURE-EX
XTFUTURE = Exchange.XTFUTURE.value
XTFUTURE_EVENT_ORDER_STATUS = EX_EVENT_ORDER_STATUS.format(XTFUTURE)
XTFUTURE_EVENT_ORDERS_STATUS = EX_EVENT_ORDERS_STATUS.format(XTFUTURE)
XTFUTURE_EVENT_ORDER_TRADE = EX_EVENT_ORDER_TRADE.format(XTFUTURE)
XTFUTURE_EVENT_TICKER = EX_EVENT_TICKER.format(XTFUTURE)
XTFUTURE_EVENT_TICKERS = EX_EVENT_TICKERS.format(XTFUTURE)
XTFUTURE_EVENT_KLINE = EX_EVENT_KLINE.format(XTFUTURE)
XTFUTURE_EVENT_MARKETCONFIG = EX_EVENT_MARKETCONFIG.format(XTFUTURE)
XTFUTURE_EVENT_MARKETDEPTH = EX_EVENT_MARKETDEPTH.format(XTFUTURE)
XTFUTURE_EVENT_OPENORDER = EX_EVENT_OPENORDER.format(XTFUTURE)
XTFUTURE_EVENT_ACCOUNT = EX_EVENT_ACCOUNT.format(XTFUTURE)
XTFUTURE_EVENT_SENDORDERS = EX_EVENT_SENDORDERS.format(XTFUTURE)
XTFUTURE_EVENT_SENDORDER = EX_EVENT_SENDORDER.format(XTFUTURE)
XTFUTURE_EVENT_CANCELORDERS = EX_EVENT_CANCELORDERS.format(XTFUTURE)
XTFUTURE_EVENT_CANCELORDER = EX_EVENT_CANCELORDER.format(XTFUTURE)
XTFUTURE_EVENT_SERVERTIMES = EX_EVENT_SERVERTIMES.format(XTFUTURE)
XTFUTURE_EVENT_ACCOUNT_BALANCE = EX_EVENT_ACCOUNT_BALANCE.format(XTFUTURE)
XTFUTURE_EVENT_ACCOUNT_FUND = EX_EVENT_ACCOUNT_FUND.format(XTFUTURE)
XTFUTURE_EVENT_ACCOUNT_MINE_TRADES = EX_EVENT_ACCOUNT_MINE_TRADES.format(XTFUTURE)


# XT4FUTURE-EX
XT4FUTURE = Exchange.XT4FUTURE.value
XT4FUTURE_EVENT_ORDER_STATUS = EX_EVENT_ORDER_STATUS.format(XT4FUTURE)
XT4FUTURE_EVENT_ORDERS_STATUS = EX_EVENT_ORDERS_STATUS.format(XT4FUTURE)
XT4FUTURE_EVENT_ORDER_TRADE = EX_EVENT_ORDER_TRADE.format(XT4FUTURE)
XT4FUTURE_EVENT_TICKER = EX_EVENT_TICKER.format(XT4FUTURE)
XT4FUTURE_EVENT_TICKERS = EX_EVENT_TICKERS.format(XT4FUTURE)
XT4FUTURE_EVENT_KLINE = EX_EVENT_KLINE.format(XT4FUTURE)
XT4FUTURE_EVENT_MARKETCONFIG = EX_EVENT_MARKETCONFIG.format(XT4FUTURE)
XT4FUTURE_EVENT_MARKETDEPTH = EX_EVENT_MARKETDEPTH.format(XT4FUTURE)
XT4FUTURE_EVENT_OPENORDER = EX_EVENT_OPENORDER.format(XT4FUTURE)
XT4FUTURE_EVENT_ACCOUNT = EX_EVENT_ACCOUNT.format(XT4FUTURE)
XT4FUTURE_EVENT_SENDORDERS = EX_EVENT_SENDORDERS.format(XT4FUTURE)
XT4FUTURE_EVENT_SENDORDER = EX_EVENT_SENDORDER.format(XT4FUTURE)
XT4FUTURE_EVENT_CANCELORDERS = EX_EVENT_CANCELORDERS.format(XT4FUTURE)
XT4FUTURE_EVENT_CANCELORDER = EX_EVENT_CANCELORDER.format(XT4FUTURE)
XT4FUTURE_EVENT_SERVERTIMES = EX_EVENT_SERVERTIMES.format(XT4FUTURE)
XT4FUTURE_EVENT_ACCOUNT_BALANCE = EX_EVENT_ACCOUNT_BALANCE.format(XT4FUTURE)
XT4FUTURE_EVENT_ACCOUNT_FUND = EX_EVENT_ACCOUNT_FUND.format(XT4FUTURE)
XT4FUTURE_EVENT_ACCOUNT_MINE_TRADES = EX_EVENT_ACCOUNT_MINE_TRADES.format(XT4FUTURE)


# BINANCE-EX
BINANCE = Exchange.BINANCE.value
BINANCE_EVENT_ORDER_STATUS = EX_EVENT_ORDER_STATUS.format(BINANCE)
BINANCE_EVENT_ORDERS_STATUS = EX_EVENT_ORDERS_STATUS.format(BINANCE)
BINANCE_EVENT_ORDER_TRADE = EX_EVENT_ORDER_TRADE.format(BINANCE)
BINANCE_EVENT_TICKER = EX_EVENT_TICKER.format(BINANCE)
BINANCE_EVENT_TICKERS = EX_EVENT_TICKERS.format(BINANCE)
BINANCE_EVENT_KLINE = EX_EVENT_KLINE.format(BINANCE)
BINANCE_EVENT_MARKETCONFIG = EX_EVENT_MARKETCONFIG.format(BINANCE)
BINANCE_EVENT_MARKETDEPTH = EX_EVENT_MARKETDEPTH.format(BINANCE)
BINANCE_EVENT_OPENORDER = EX_EVENT_OPENORDER.format(BINANCE)
BINANCE_EVENT_ACCOUNT = EX_EVENT_ACCOUNT.format(BINANCE)
BINANCE_EVENT_SENDORDERS = EX_EVENT_SENDORDERS.format(BINANCE)
BINANCE_EVENT_SENDORDER = EX_EVENT_SENDORDER.format(BINANCE)
BINANCE_EVENT_CANCELORDERS = EX_EVENT_CANCELORDERS.format(BINANCE)
BINANCE_EVENT_CANCELORDER = EX_EVENT_CANCELORDER.format(BINANCE)
BINANCE_EVENT_SERVERTIMES = EX_EVENT_SERVERTIMES.format(BINANCE)
BINANCE_EVENT_ACCOUNT_BALANCE = EX_EVENT_ACCOUNT_BALANCE.format(BINANCE)
BINANCE_EVENT_ACCOUNT_FUND = EX_EVENT_ACCOUNT_FUND.format(BINANCE)

# FTX-EX
FTX = Exchange.FTX.value
FTX_EVENT_ORDER_STATUS = EX_EVENT_ORDER_STATUS.format(FTX)
FTX_EVENT_ORDERS_STATUS = EX_EVENT_ORDERS_STATUS.format(FTX)
FTX_EVENT_ORDER_TRADE = EX_EVENT_ORDER_TRADE.format(FTX)
FTX_EVENT_TICKER = EX_EVENT_TICKER.format(FTX)
FTX_EVENT_TICKERS = EX_EVENT_TICKERS.format(FTX)
FTX_EVENT_KLINE = EX_EVENT_KLINE.format(FTX)
FTX_EVENT_MARKETCONFIG = EX_EVENT_MARKETCONFIG.format(FTX)
FTX_EVENT_MARKETDEPTH = EX_EVENT_MARKETDEPTH.format(FTX)
FTX_EVENT_OPENORDER = EX_EVENT_OPENORDER.format(FTX)
FTX_EVENT_ACCOUNT = EX_EVENT_ACCOUNT.format(FTX)
FTX_EVENT_SENDORDERS = EX_EVENT_SENDORDERS.format(FTX)
FTX_EVENT_SENDORDER = EX_EVENT_SENDORDER.format(FTX)
FTX_EVENT_CANCELORDERS = EX_EVENT_CANCELORDERS.format(FTX)
FTX_EVENT_CANCELORDER = EX_EVENT_CANCELORDER.format(FTX)
FTX_EVENT_SERVERTIMES = EX_EVENT_SERVERTIMES.format(FTX)
FTX_EVENT_ACCOUNT_BALANCE = EX_EVENT_ACCOUNT_BALANCE.format(FTX)
FTX_EVENT_ACCOUNT_FUND = EX_EVENT_ACCOUNT_FUND.format(FTX)
